Skip to content

feat(lambda): declare the scope's available actions in its spec - #35

Merged
agustincelentano merged 1 commit into
mainfrom
feat/declare-available-actions
Aug 3, 2026
Merged

feat(lambda): declare the scope's available actions in its spec#35
agustincelentano merged 1 commit into
mainfrom
feat/declare-available-actions

Conversation

@agustincelentano

Copy link
Copy Markdown
Contributor

Declares the actions this scope offers inside its own spec, so the
scope_definition module can read them instead of carrying a hardcoded default.

Why

The list lived in the module, far from the scope that implements the actions, and
that distance let the two drift. The default listed kill-instances while the
containers scope ships kill-instance.json.tpl; the module built a URL from the
wrong name, got a 404, and the body 404: Not Found reached jq as if it were the
template:

jq: parse error: Expected string key before ':' at line 1

An error that says nothing about a missing file. With the list next to the
templates it names, adding or renaming an action is one change in one place.

What it adds

Fourteen actions, matching both the templates in lambda/specs/actions/ and the
specifications currently registered for this scope:

create-scope  update-scope  delete-scope
start-initial  start-blue-green  finalize-blue-green  switch-traffic
rollback-deployment  delete-deployment
adjust-provisioned-concurrency  adjust-reserved-concurrency  invoke
diagnose-deployment  diagnose-scope

Verified that the rendered spec parses as JSON and that every name has its
.json.tpl.

Merge order

Needs nullplatform/tofu-modules#458, which makes the module read this field.
Until that merges this changes nothing, and it is harmless on its own.

Worth noting the reverse is not true: that PR removes the module's default, so a
scope whose spec does not declare available_actions ends up with an empty list —
and an empty list in a for_each destroys every action specification. This scope
had fourteen at risk.

🤖 Generated with Claude Code

The list of actions a scope offers lived in the scope_definition module as a
hardcoded default, far from the scope that implements them. That distance is what
let them drift: the default listed "kill-instances" while the containers scope
ships "kill-instance", and the mismatched name resolved to a 404 whose body
reached jq as "404: Not Found" — a parse error that said nothing about a missing
file.

Declaring them here puts the list next to the action templates it names, so
adding or renaming an action is one change in one repository.

The fourteen match the action templates in specs/actions and the specifications
currently registered for this scope.

Requires the module to read the field: nullplatform/tofu-modules#458.

@sebastiancorrea81 sebastiancorrea81 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@agustincelentano
agustincelentano merged commit 7766a59 into main Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants